<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page contentType="text/html; charset=GB2312" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'people.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body bgcolor="cyan"><FONT size=3>
  	<%!	int count;
  		StringBuffer personList;
  		public void judge(){
  			if(count==0)
  				personList=new StringBuffer();
  		}
  		public void addPerson(String p){
  			if(count==0)
  				personList.append(p);
  			else
  				personList.append(","+p);
  			count++;
  		}
  	 %>
  	 <% String name=request.getParameter("name");
  	    byte bb[] = name.getBytes("iso-8859-1");
  	    name=new String(bb);
  	    if(name.length()==0||name.length()>10){
  	 %><jsp:forward page="inputName.jsp"/>
  	 <%}
  	 	judge();
  	 	addPerson(name);
  	  %>
  	  <br>目前共有<%=count %>人浏览了该网页，他们的名字是：
  	  <br><%=personList %>
  </body>
</html>
